﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace Barbar.UrlGuard.Controls {
  public class TreeContextMenu : ContextMenu, ILocalizable {
    private MenuItem m_AddChain;
    public event EventHandler Command;

    public TreeContextMenu() {
      m_AddChain = new MenuItem("Add new chain", OnMenuClick);
      MenuItems.Add(m_AddChain);
    }

    private void OnMenuClick(object sender, EventArgs e) {
      if (Command != null) {
        Command(this, EventArgs.Empty);
      }
    }

    #region ILocalizable Members

    public void Localize(ILocalizator localizator) {
      if (localizator == null)
        throw new ArgumentNullException("localizator");
      m_AddChain.Text = localizator.Translate("TreeCommand_AddChain");
    }

    #endregion
  }
}
